package com.liachen.stock.entity.etf;

import com.alibaba.fastjson.annotation.JSONField;
import com.liachen.common.util.DateUtil;
import lombok.Data;

import java.util.Date;

@Data
public class Etf {

	private int followedNum;

	private String stockType;

	private String indexId;

	private Index index;

	private String type;

	private String stockCode;
	/**
	 * 成交额
	 */
	private long to;

	private String fundSecondLevel;

	private String fundType;

	private String lastUpdated;

	private String areaCode;

	private long stockId;

	private String name;

	@JSONField(name="exchange")
	private String exchange;

	@JSONField(name="_id")
	private long id;

	@JSONField(name="shortName")
	private String shortName;

	@JSONField(name="tickerId")
	private int tickerId;

	@JSONField(name="status")
	private String status;

	public int getFollowedNum() {
		return this.index.getFollowedNum();
	}

	public double getThreeYearClosePointChange() {
		return this.index.getThreeYearClosePointChange();
	}

	public double getFiveYearClosePointChange() {
		return this.index.getFiveYearClosePointChange();
	}

	public String getDescription() { return this.index.getDescription(); }

	public Date getLaunchDate() {
		return DateUtil.toDate(this.index.getLaunchDate(), DateUtil.SPECIAL_DATE_FORMAT);
	}

}
